package com.heyige.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Data
@Schema(description = "聊天相关数据传输对象")
public class ChatDto {

    @Setter
    @Getter
    @Schema(description = "聊天请求")
    public static class ChatRequest {
        @Schema(description = "会话ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "会话ID不能为空")
        private Long sessionId;
        
        @Schema(description = "消息内容", example = "你好，请介绍一下自己", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotBlank(message = "消息内容不能为空")
        private String content;
        
        @Schema(description = "使用的AI模型", example = "deepseek")
        private String model;
        
        @Schema(description = "温度参数", example = "0.7")
        private Double temperature;
        
        @Schema(description = "系统提示词列表")
        private List<String> systemPrompt;
    }

    @Setter
    @Getter
    @Schema(description = "聊天响应")
    public static class ChatResponse {
        @Schema(description = "回复内容", example = "你好！我是一个AI助手，很高兴为您服务。")
        private String content;
        
        @Schema(description = "使用的AI模型", example = "deepseek")
        private String model;
        
        @Schema(description = "消耗的token数量", example = "150")
        private Integer tokens;
        
        @Schema(description = "响应时间（毫秒）", example = "2000")
        private Long responseTime;
    }

    @Setter
    @Getter
    @Schema(description = "创建会话请求")
    public static class CreateSessionRequest {
        @Schema(description = "会话标题", example = "新的聊天", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotBlank(message = "会话标题不能为空")
        private String title;
        
        @Schema(description = "指定使用的AI模型", example = "deepseek")
        private String model;
    }

    @Setter
    @Getter
    @Schema(description = "会话响应")
    public static class SessionResponse {
        @Schema(description = "会话ID", example = "1")
        private Long id;
        
        @Schema(description = "用户ID", example = "1")
        private Long userId;
        
        @Schema(description = "会话标题", example = "新的聊天")
        private String title;
        
        @Schema(description = "模型类型", example = "deepseek")
        private String modelType;
        
        @Schema(description = "消息数量", example = "5")
        private Integer messageCount;
        
        @Schema(description = "总token数", example = "1000")
        private Integer totalTokens;
        
        @Schema(description = "是否活跃", example = "true")
        private Boolean isActive;
        
        @Schema(description = "最后消息时间", example = "2024-01-01T12:00:00")
        private String lastMessageTime;
        
        @Schema(description = "创建时间", example = "2024-01-01T10:00:00")
        private String createdAt;
    }
}